<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.apache.workday.*"%>
<%@ page import="com.apache.tools.*"%>
<%@ page import="net.sf.json.*"%>
<%@ page import="java.util.Date"%>

<%
	String act = request.getParameter("act");
	String day= request.getParameter("day");
	if("set".equals(act)){
		//设置是否工作日
		String isWorkday= request.getParameter("isWorkday");
		WorkdayUtils.getInstance().setDay(day,"T".equals(isWorkday));
		out.print("T");
	}else if("after".equals(act)){
		String ndays = request.getParameter("ndays");
		//Date startDay = com.apahce.tools.DateUtils.strToDate(day,"yyyyMMdd");
		//java.util.Date endDay  = WorkdayUtils.afterWorkday(startDay,NumberUtils.getInt(ndays,0));
		String endDay =  WorkdayUtils.getInstance().afterWorkday(day,NumberUtils.getInt(ndays,0));
		out.print(endDay.trim());
	}else{
		String year= request.getParameter("year");
		year = StrUtil.doNull(year,DateUtils.Now.fmt_yyyy());//默认取当前年	
		java.util.List<Workday> list =  WorkdayUtils.getInstance().getDayListOfYear(year);
		String jsonStr = JSONArray.fromObject(list).toString();
		out.print(jsonStr);
	}
%>